import pandas as pd

df = pd.DataFrame([
    ['aa', 'bb', 'cc'],
    ['ae', 'bg', 'df'],
    ['cx', 'ew', 'fe'],
])


def get_search_df(kw):
    mask = df.applymap(lambda x: kw in x)
    print(mask)
    print(df[mask.any(axis=1)])


get_search_df('a')
